# __slots__限定属性后新增会报错
class Student(object):
    __slots__ = ('name', 'age') # 用tuple定义允许绑定的属性名称
    def __init__(self,name,age):
        self.name = name
        self.age = age
        
s1 = Student("张三",18)
# 报错
# s1.aa = 2